<template>
  <h1>app组件标题 验证自定义事件</h1>
  <p>来自子组件传过来的数据:{{ sonValue }}</p>
  <hr />
  <Count @FooCount="getSonValue"></Count>
</template>


<script>
import Count from "./components/Count.vue";
import { ref } from "vue";
export default {
  name: "App",
  setup() {
    // 接收函数传来的参数
    let sonValue = ref("");

    // 定义事件接收传递过来的数据
    function getSonValue(val) {
      sonValue.value = val;
    }

    return {
      sonValue,
      getSonValue,
    };
  },
  components: { Count },
};
</script>

<style>
</style>